#pragma once

class Dialogue
{
	enum State
	{
		Appearing,
		TextShowing,
		Disappearing,
		Finished
	};
public:
	Dialogue();
	void Load(std::vector<const char*>& textList, std::vector<bool>& speakerList);
	void Draw(sf::RenderWindow& window);
	void Step();
	bool IsActive();
private:
	void ResetText();

	State state;
	sf::RectangleShape bg;
	float timer;
	std::vector<const char*>* textList;
	std::vector<bool>* speakerList;
	int dialogueLength;
	int dialogueStep;
	sf::Font font;
	sf::Text text;
	sf::Color activeColor;
	bool skipFlag;
	float textShift;

	sf::SoundBuffer voiceBuffers[4];
	sf::Sound voiceSounds[4];

	sf::Sound* activeSound;
};

extern Dialogue activeDialogue;